const express =require('express')
const mongoose=require('mongoose')
const app=express()
app.listen(8080)
mongoose.connect('mongodb://localhost:27017/mydemo',{useNewUrlParser:true,useUnifiedTopology:true})
app.get('/',(req,res)=>{
    res.send('数据库')
})
var userSchema=new mongoose.Schema({
    name:String,
    id:String
})
var model=mongoose.model('user',userSchema,'user')
userSchema.find().then(res=>{
    console.log(res,'sss')
})